package com.example.video.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author qiusuyang
 * @since 2024-04-13
 */
@Data
public class Video implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 视频标题
     */
    private String title;

    /**
     * 翻译后的视频标题
     */
    private String translateTitle;

    /**
     * 作者id
     */
    private Integer accountId;

    /**
     * 接收的视频id
     */
    private String resourceId;

    /**
     * 下载状态
     */
    private Integer status;

    /**
     * 视频链接
     */
    private String medias;

    /**
     * 记录时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 资源类型：video/image
     */
    private String errMsg;
    /**
     * 封面地址
     */
    private String errCursor;

    /**
     * 发送上传错误的平台
     */
    private String publishErr;

//    /**
//     * 所属角色
//     */
//    private String role;
    /**
     * 源视频发布时间，可能为null
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date publishTime;

    @Override
    public String toString() {
        return "Video{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", accountId=" + accountId +
                ", resourceId='" + resourceId + '\'' +
                ", status=" + status +
                ", medias='" + medias + '\'' +
                ", createTime=" + createTime +
                ", errMsg='" + errMsg + '\'' +
                ", errCursor='" + errCursor + '\'' +
                ", publishTime=" + publishTime +
                '}';
    }
}
